home *** CD-ROM | disk | FTP | other *** search
/ Softdisk for Windows 42 / Softdisk for Windows 42.iso / INSTALL / L_RALLY / OLDZIP / L_RALLY.EXE / Lab.dxr / 00001_MovScript.ls next >
Encoding:
Text File  |  1998-01-23  |  6.9 KB  |  261 lines

  1. on startMovie
  2.   global Saddit, sDoublure, sLETTRES, equiva, lences, sTrans1, niveau, sTuile1, sEcran
  3.   set sEcran to 50
  4.   set Saddit to 15
  5.   set sDoublure to 16
  6.   set sTuile1 to 3
  7.   set sLETTRES to 9
  8.   set sTrans1 to 26
  9.   set equiva to [121, 128, 129, 133, 135, 140, 141, 142, 143, 144, 145, 68, 69, 74, 75, 84, 86, 183, 184, 185, 188, 189, 191, 195, 204]
  10.   set lences to [1, 8, 9, 13, 15, 20, 21, 22, 23, 24, 25, 8, 9, 14, 15, 24, 26, 3, 4, 5, 8, 9, 11, 15, 24]
  11.   if voidp(niveau) then
  12.     set niveau to 1
  13.   end if
  14.   set destin to "niv" & niveau
  15.   go(destin)
  16. end
  17.  
  18. on initCurseur
  19.   global sTuile1
  20.   repeat with s = sTuile1 to sTuile1 + 5
  21.     set the cursor of sprite s to [member 19, member 20]
  22.   end repeat
  23. end
  24.  
  25. on resetPuzzle
  26.   global niveau
  27.   PuppetsOFF()
  28.   set destin to "niv" & niveau
  29.   go(destin)
  30. end
  31.  
  32. on bougeLe qui
  33.   global Saddit, sDoublure, sPlaque
  34.   switche(qui, Saddit)
  35.   set sPlaque to qui - 6
  36.   repeat while the stillDown
  37.     set crit to 12
  38.     set oldX to the locH of sprite Saddit
  39.     set oldY to the locV of sprite Saddit
  40.     set the loc of sprite sDoublure to the loc of sprite Saddit
  41.     set demandeX to the mouseH - oldX
  42.     set demandeY to the mouseV - oldY
  43.     if abs(demandeX) > abs(demandeY) then
  44.       if demandeX > crit then
  45.         set the locH of sprite sDoublure to oldX + crit
  46.       else
  47.         if demandeX < -crit then
  48.           set the locH of sprite sDoublure to oldX - crit
  49.         end if
  50.       end if
  51.       updateStage()
  52.       if sprite sDoublure within 1 and lesAutres(qui - 6) then
  53.         if the locH of sprite sDoublure <> the locH of sprite Saddit then
  54.           set the locH of sprite Saddit to the locH of sprite sDoublure
  55.           set the locH of sprite sPlaque to the locH of sprite sDoublure
  56.           puppetSound("glisseContinu")
  57.           updateStage()
  58.         end if
  59.       end if
  60.       next repeat
  61.     end if
  62.     if demandeY > crit then
  63.       set the locV of sprite sDoublure to oldY + crit
  64.     else
  65.       if demandeY < -crit then
  66.         set the locV of sprite sDoublure to oldY - crit
  67.       end if
  68.     end if
  69.     updateStage()
  70.     if sprite sDoublure within 1 and lesAutres(qui - 6) then
  71.       if the locV of sprite sDoublure <> the locV of sprite Saddit then
  72.         set the locV of sprite Saddit to the locV of sprite sDoublure
  73.         set the locV of sprite sPlaque to the locV of sprite sDoublure
  74.         puppetSound("glisseContinu")
  75.         updateStage()
  76.       end if
  77.     end if
  78.   end repeat
  79.   switche(Saddit, qui)
  80.   verifie()
  81. end
  82.  
  83. on verifie
  84.   global leProb, sLETTRES, equiva, lences
  85.   repeat with s = sLETTRES to sLETTRES + 5
  86.     if the locV of sprite s < 398 then
  87.       exit
  88.     end if
  89.   end repeat
  90.   repeat with s = sLETTRES to sLETTRES + 5
  91.     set c to the memberNum of sprite s
  92.     set pos to getOne(equiva, c)
  93.     if pos <> 0 then
  94.       set the memberNum of sprite s to getAt(lences, pos)
  95.       updateStage()
  96.     end if
  97.   end repeat
  98.   set lesLettres to ordreObtenu()
  99.   repeat with lettre = 1 to 6
  100.     if getAt(lesLettres, lettre) <> getAt(leProb, lettre) then
  101.       exit
  102.     end if
  103.   end repeat
  104.   onLa()
  105.   retourne(1)
  106. end
  107.  
  108. on ordreObtenu
  109.   global sLETTRES
  110.   set laListe to []
  111.   repeat with p = 1 to 6
  112.     set posH to (p * 48) + 152
  113.     repeat with s = sLETTRES to sLETTRES + 5
  114.       if the locH of sprite s = posH then
  115.         append(laListe, the memberNum of sprite s)
  116.       end if
  117.     end repeat
  118.   end repeat
  119.   return laListe
  120. end
  121.  
  122. on lesAutres qui
  123.   global sDoublure, Saddit, sTrans1, nTrans, sTuile1
  124.   set Ok to 1
  125.   set deb to sTrans1 + nTrans
  126.   set fin to deb + nTrans - 1
  127.   repeat with s = deb to fin
  128.     if sprite sDoublure intersects s and (the locV of sprite s = the locV of sprite sDoublure) then
  129.       set tiensMoiCa to the locH of sprite sDoublure
  130.       set the locH of sprite sDoublure to (the locH of sprite s * 2) - the locH of sprite Saddit
  131.       updateStage()
  132.       if yaPersonneA(sDoublure) then
  133.         transforme(s)
  134.       end if
  135.       set the locH of sprite sDoublure to tiensMoiCa
  136.       set Ok to 0
  137.       exit repeat
  138.     end if
  139.   end repeat
  140.   repeat with s = sTuile1 to sTuile1 + 5
  141.     if sprite sDoublure intersects s and (s <> qui) then
  142.       set Ok to 0
  143.       exit repeat
  144.     end if
  145.   end repeat
  146.   return Ok
  147. end
  148.  
  149. on yaPersonneA qui
  150.   global sTuile1
  151.   set Ok to 1
  152.   repeat with s = sTuile1 to sTuile1 + 5
  153.     if sprite qui intersects s and (s <> qui) then
  154.       set Ok to 0
  155.       exit repeat
  156.     end if
  157.   end repeat
  158.   return Ok
  159. end
  160.  
  161. on transforme sTrans
  162.   global Saddit, sPlaque, nTrans
  163.   if the locH of sprite Saddit < the locH of sprite sTrans then
  164.     set diff to 2
  165.     set the locH of sprite Saddit to the locH of sprite sTrans - 34
  166.     set the locH of sprite sPlaque to the locH of sprite sTrans - 34
  167.     updateStage()
  168.   else
  169.     set diff to -2
  170.     set the locH of sprite Saddit to the locH of sprite sTrans + 34
  171.     set the locH of sprite sPlaque to the locH of sprite sTrans + 34
  172.     updateStage()
  173.   end if
  174.   puppetSound("magnetik")
  175.   repeat while the locH of sprite Saddit <> the locH of sprite sTrans
  176.     set the locH of sprite Saddit to the locH of sprite Saddit + diff
  177.     set the locH of sprite sPlaque to the locH of sprite sPlaque + diff
  178.     updateStage()
  179.     niaise(1)
  180.   end repeat
  181.   animeLeTransfo(sTrans, diff)
  182.   set the member of sprite Saddit to member transformeLettre(sTrans, diff) of castLib "lettres.cst"
  183.   updateStage()
  184.   puppetSound("magnetik")
  185.   updateStage()
  186.   repeat with i = 1 to 24
  187.     set the locH of sprite Saddit to the locH of sprite Saddit + diff
  188.     set the locH of sprite sPlaque to the locH of sprite sPlaque + diff
  189.     updateStage()
  190.     niaise(1)
  191.   end repeat
  192. end
  193.  
  194. on animeLeTransfo sTrans, direction
  195.   set c to the memberNum of sprite sTrans
  196.   puppetSound("inverseur")
  197.   updateStage()
  198.   if direction > 0 then
  199.     repeat with i = 0 to 7
  200.       set the memberNum of sprite sTrans to member (c + i) of castLib 1
  201.       updateStage()
  202.       attends(5)
  203.     end repeat
  204.   else
  205.     repeat with i = 7 down to 0
  206.       set the memberNum of sprite sTrans to member (c + i) of castLib 1
  207.       updateStage()
  208.       attends(5)
  209.     end repeat
  210.   end if
  211.   set the memberNum of sprite sTrans to member c of castLib 1
  212.   repeat while soundBusy(1)
  213.     updateStage()
  214.   end repeat
  215. end
  216.  
  217. on transformeLettre sTrans, direction
  218.   global Saddit
  219.   set cTrans to the memberNum of sprite sTrans
  220.   set cn to the memberNum of sprite Saddit
  221.   if cTrans = 31 then
  222.     if cn < 120 then
  223.       return cn + 120
  224.     else
  225.       return cn - 120
  226.     end if
  227.   else
  228.     if cTrans = 41 then
  229.       if cn < 60 then
  230.         return cn + 60
  231.       else
  232.         if cn < 120 then
  233.           return cn - 60
  234.         else
  235.           if cn < 180 then
  236.             return cn + 60
  237.           else
  238.             return cn - 60
  239.           end if
  240.         end if
  241.       end if
  242.     else
  243.       if cTrans = 51 then
  244.         if direction > 0 then
  245.           if (cn mod 30) = 26 then
  246.             return cn - 25
  247.           else
  248.             return cn + 1
  249.           end if
  250.         else
  251.           if (cn mod 30) = 1 then
  252.             return cn + 25
  253.           else
  254.             return cn - 1
  255.           end if
  256.         end if
  257.       end if
  258.     end if
  259.   end if
  260. end
  261.